var reg1 = /\n/g
console.log(reg1.test('hello \n js'));